package com.sodimac.v2s.business
{
 	import com.adobe.cairngorm.business.ServiceLocator;
 	
 	import flash.xml.XMLDocument;
 	import flash.xml.XMLNode;
 	
 	import mx.collections.ArrayCollection;
 	import mx.rpc.AsyncToken;
 	import mx.rpc.IResponder;
 	import mx.rpc.soap.WebService;
 	import mx.rpc.xml.SimpleXMLEncoder;	
	
	public class SaveOCDelegate
	{
		
		private var service:WebService;
		private var responder:IResponder;		
		
		public function SaveOCDelegate(responder:IResponder)
		{
			this.service = ServiceLocator.getInstance().getWebService("wsGrabarOrdenDeCompra");
			this.responder = responder;
		}

	
		public function GrabarOrdenCompra(cabecera: Object, 
										   idPedidoCorp: Number,
										   idOC: Number,
										   idPais: String, 
										   fechaOC:Date,
										   idEmpresa: String):void
		{
			trace("SaveOCDelegate.GrabarOrdenCompra (PedidoCorp="+ idPedidoCorp +")");
			var payload:Object = new Object();
			payload.idPedidoCorp = idPedidoCorp;
			payload.numeroOC = idOC;
			payload.idPais = idPais;
			payload.fechaOC = fechaOC;
			payload.idEmpresa = idEmpresa;

			var call:AsyncToken  = service.grabaOrdenDeCompra(cabecera, payload);
			call.addResponder( responder );
		}											



		

	}
}

